<#assign menu="decoration">
<#assign submenu="add_decoration">
<#include "../../manage/head.ftl">
<!--main content start-->
<section id="main-content">
    <section class="wrapper">

        <form id="add_decoration_form" class="form-horizontal" action="${BASE_PATH}/manage/decoration/add.json"
              autocomplete="off" method="post"
              enctype="multipart/form-data">
            <div class="row">
                <div class="col-lg-12">
                    <section class="panel">
                        <header class="panel-heading">
                            添加装饰
                        </header>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">图片</label>

                                <div class="col-sm-10">
                                    <input type="file" name="file"
                                           id="file">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">类型</label>

                                <div class="col-sm-10">
                                    <select class="form-control" name="type" style="font-size:15px;width: 300px;" id="goodsType-select">
                                        <option value="1">
                                            造型
                                        </option>
                                        <option value="2">
                                            装饰
                                        </option>
                                        <option value="3">
                                            背景
                                        </option>
                                    </select>
                                </div>
                            </div>

                        </div>
                        <div class="form-group">
                            <div class="col-lg-offset-2 col-lg-10">
                                <button class="btn btn-shadow btn-primary" type="submit">发布</button>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </form>

    </section>
</section>

<!--main content end-->
<script type="text/javascript">
    $(function () {
        $('#add_decoration_form').ajaxForm({
            dataType: 'json',
            success: function (data) {
                if (data.result) {
                    bootbox.alert("保存成功，将刷新页面", function () {
                        window.location.reload();
                    });
                } else {
                    showErrors($('#add_decoration_form'), data.errors);
                }
            }
        });

        $('.js_create_time').datetimepicker({
            language: 'zh-CN',
            format: "yyyy-mm-dd",
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,
            forceParse: 0
        });
    });
    $("#decorationType-select").val("");
    $("#googsBrand-select").val("");
    $("#category-select").val("");

</script>
<#include "../../manage/foot.ftl">